package cn.wangkai.peanut.system.db;

import cn.wangkai.peanut.db.Db;
import cn.wangkai.peanut.db.iface.IDb;

public class PeanutDb extends Db implements IDb  {
	private volatile static PeanutDb faction = null;
	private static int dbtype = DB_MYSQL;
	/**
	 * @deprecated {@link #Open()} instead
	 */
	public PeanutDb() {

	}

	/**
	 * 打开
	 * @return GsdDb
	 */
	public static PeanutDb Open() {
		while (faction == null) {
			synchronized (PeanutDb.class) {
				if (faction == null) {
					faction = new PeanutDb();
				}
			}
		}
		return faction;
	}
	/**
	 * 连接池启动
	 * @throws Exception
	 */
	public int getDbtype(){
		return dbtype;
	}
	public void VStartPool() {
		super.VStartPool("peanutdb");
	}

	public static void main(String[] args) {
		PeanutDb db = PeanutDb.Open();
		System.out.println(db.getDbtype());
	}
	
}